from base.request_new import RequestNew
from business.cookiesgetter.getter import user_login
from datetime import datetime
from business.sign.get_sign import get_box_sign
import asyncio
from config import base_url
from functools import reduce
from operator import add


token = user_login("app", 0)
rt = RequestNew()

total = list()


async def get_grading_detail():
    timestamp = int(datetime.now().timestamp() * 1000)

    req = {
        "url": "",
        "data": {
        },
        "method": "GET"
    }
    r, v = rt.request_auto(**req)
    return end - start


async def run():
    with open(f"{base_url}/business/gradingranking/result_1000_2.log", "a+") as f:
        f.write("test \n")
        for i in range(1, 1001):
            r = await get_grading_detail()
            total.append(r)
            f.write(f"{i}:{r}\n")
            f.flush()
        f.write()


if __name__ == '__main__':
    asyncio.run(run())
